<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<head th:replace="/common/header"></head>
<body>
	<form th:id="loginForm" th:method="post">
		<p><input th:name="account" th:placeholder="请输入用户名" th:type="text" /></p>
		<p><input th:name="password" th:placeholder="请输入密码" th:type="password" /></p>
		<p><input th:type="button" th:value="登陆" th:onclick="'login();'" /></p>
	</form>
	
	<div th:replace="/common/script"></div>
	
	<script th:inline="javascript">
	//登陆
	/*<![CDATA[*/
	var login = function(){
		$.http.submitForm({
			url:"/login",
			data:$("#loginForm").serialize(),
			success:function(r){
				if(r && r.success){
					var url = "/system";
					window.location.href=url;
				} else {
					//后面的参数是跳转到哪个路径用的，如果不跳转就传null
					$.prompt.alert(r.msg, null);
				}
			}
		});
	};
	/*]]>*/
	</script>
</body>
</html>